import React from 'react'
import Child from './child'

import {Button} from 'antd'
// import 'antd/dist/antd.css';

import './index.less'



class Life extends React.Component{
    constructor(props){
       super(props)
       this.state={
           count:0
       }
    }
    handleAdd=()=>{
        this.setState({
            count:this.state.count+1
        })
    }
    handleClick(){
        this.setState({
            count:this.state.count+1
        })
    }
    render(){

        return <div  className='content'>
            <p>react 生命周期介绍</p>
            <Button onClick={this.handleAdd}>Antd点击一下</Button>
            {/* <button onClick={this.handleAdd}>点击一下</button> */}
            <button onClick={this.handleClick.bind(this)}>点击一下</button>
            <p>{this.state.count}</p>
            <Child count={this.state.count}></Child>
        </div>
    }
}

export default Life